﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using LibCommon;
using RTCCore;

namespace LibRTC.Core.MessageMap.ParticipantStateChangeEvent {
    public class ParticipantStateChangeHandler : SimpleMessageHandler
    {
        private static ILogger LOGGER = LoggerFactory.GetLogger("ParticipantStateChangeHandler", null);

        private RTCCoreClient _coreClient;

        public ParticipantStateChangeHandler() {
            _rtcEvent = RTC_EVENT.RTCE_PARTICIPANT_STATE_CHANGE;
            _name = "ParticipantStateChangeHandler";
        }

        public void SetRTCCoreClient(RTCCoreClient client)
        {
            Debug.Assert(null != client);
            _coreClient = client;
        }

        public override void Process(RTC_EVENT rtcEventType, object rtcEvent)
        {
            Debug.Assert(RTC_EVENT.RTCE_PARTICIPANT_STATE_CHANGE == rtcEventType);
            Debug.Assert(null != rtcEvent);
            Debug.Assert(rtcEvent is IRTCParticipantStateChangeEvent);

            IRTCParticipantStateChangeEvent rtcParticipantStateChangeEvent = (IRTCParticipantStateChangeEvent)rtcEvent;

            switch (rtcParticipantStateChangeEvent.State)
            {
                case RTC_PARTICIPANT_STATE.RTCPS_DISCONNECTED:
                    
                    break;
                default:
                    break;
            }
            
        }
    }
}